/**
 *
 */
package cn.com.generaldata.os.pojo.mvc;

import java.util.ArrayList;
import java.util.Date;
import java.util.List;

import javax.xml.bind.annotation.XmlElement;
import javax.xml.bind.annotation.XmlElementWrapper;
import javax.xml.bind.annotation.XmlRootElement;

/**
 * @author acer
 * 
 */
@XmlRootElement(name = "report")
public class Report {
	private String reportId;
	private String reportReferenceId;
	private String reportType;
	private String reportTypeCode; // such as s01, s02 ....
	private String reportUserId;
	private String regionName;
	private String regionOcean;
	private String cityName;
	private String departmentName;
	private String regionCode;
	private String reportUnit;
	private String reportUnitIndustry;
	private String reportUnitIndustryId;
	private String institutionName;
	private String institutionCode;
	private String domainName;
	private String domainCode;
	private String reportYear;
	private String reportQuarter;
	private String reportNo;
	private String reportAdmin;
	private String approveAdmin;
	private String approveNo;
	private String expireDate;
	private String measureUnit;
	private String unitAdmin;
	private String statAdmin;
	private String fillAdmin;
	private String reportDate;
	private String reportOrigin;
	private String reportSupplyOrigin;
	private String reportDesc;
	private Date createDate;
	private Date lastEditDate;
	private String reportOperatorId;
	private String reportAreaId;
	private String unitId;
	private Date updateTime; // 修改时间

	// 0, user status
	// 1, commit status
	// 2, check success
	// 3, check fail
	private byte checkStatus;
	private String checkComment;
	private String checkResult;
	private Date checkSuccessDate;
	private String reportRemark;
	private String reportFlag;
	private String reportProxyId;
	private String reportTimetype;
	private String reportMonth;
	private String reportYearTime;
	private String reportVersion;
	private String reportTypeId;
	private String reportEdition;
	private String selfSet1;
	private String selfSet2;
	private String selfSet3;
	private String selfSet4;
	private String selfSet5;
	private Integer quarter;
	private Integer month;
	private String status;

	public String getSelfSet1() {
		return selfSet1;
	}

	public void setSelfSet1(String selfSet1) {
		this.selfSet1 = selfSet1;
	}

	public String getSelfSet2() {
		return selfSet2;
	}

	public void setSelfSet2(String selfSet2) {
		this.selfSet2 = selfSet2;
	}

	public String getSelfSet3() {
		return selfSet3;
	}

	public void setSelfSet3(String selfSet3) {
		this.selfSet3 = selfSet3;
	}

	public String getSelfSet4() {
		return selfSet4;
	}

	public void setSelfSet4(String selfSet4) {
		this.selfSet4 = selfSet4;
	}

	public String getSelfSet5() {
		return selfSet5;
	}

	public void setSelfSet5(String selfSet5) {
		this.selfSet5 = selfSet5;
	}

	// @XmlElementWrapper
	// @XmlElement(name = "row")
	private List<Row> rows;

	public Report() {
	}

	public Report(String reportId, String reportReferenceId, String reportType, String reportTypeCode,
			String reportUserId, String regionName, String regionOcean, String cityName, String departmentName,
			String regionCode, String reportUnit, String reportUnitIndustry, String reportUnitIndustryId,
			String institutionName, String institutionCode, String domainName, String domainCode, String reportYear,
			String reportQuarter, String reportNo, String reportAdmin, String approveAdmin, String approveNo,
			String expireDate, String measureUnit, String unitAdmin, String statAdmin, String fillAdmin,
			String reportDate, String reportOrigin, String reportSupplyOrigin, String reportDesc, Date createDate,
			Date lastEditDate, String reportOperatorId, String reportAreaId, byte checkStatus, String checkComment,
			String checkResult, Date checkSuccessDate, String reportRemark, String reportFlag, String reportProxyId,
			List<Row> rows, String reportTimetype, String reportMonth, String reportYearTime, String reportVersion,
			String reportTypeId, String reportEdition, String selfSet1, String selfSet2, String selfSet3,
			String selfSet4, String selfSet5, Integer quarter, Integer month, String unitId, Date updateTime) {
		this.reportId = reportId;
		this.reportReferenceId = reportReferenceId;
		this.reportType = reportType;
		this.reportTypeCode = reportTypeCode;
		this.reportUserId = reportUserId;
		this.regionName = regionName;
		this.regionOcean = regionOcean;
		this.cityName = cityName;
		this.departmentName = departmentName;
		this.regionCode = regionCode;
		this.reportUnit = reportUnit;
		this.reportUnitIndustry = reportUnitIndustry;
		this.reportUnitIndustryId = reportUnitIndustryId;
		this.institutionName = institutionName;
		this.institutionCode = institutionCode;
		this.domainName = domainName;
		this.domainCode = domainCode;
		this.reportYear = reportYear;
		this.reportQuarter = reportQuarter;
		this.reportNo = reportNo;
		this.reportAdmin = reportAdmin;
		this.approveAdmin = approveAdmin;
		this.approveNo = approveNo;
		this.expireDate = expireDate;
		this.measureUnit = measureUnit;
		this.unitAdmin = unitAdmin;
		this.statAdmin = statAdmin;
		this.fillAdmin = fillAdmin;
		this.reportDate = reportDate;
		this.reportOrigin = reportOrigin;
		this.reportSupplyOrigin = reportSupplyOrigin;
		this.reportDesc = reportDesc;
		this.createDate = createDate;
		this.lastEditDate = lastEditDate;
		this.reportOperatorId = reportOperatorId;
		this.reportProxyId = reportProxyId;
		this.reportAreaId = reportAreaId;
		this.checkStatus = checkStatus;
		this.checkComment = checkComment;
		this.checkResult = checkResult;
		this.checkSuccessDate = checkSuccessDate;
		this.reportRemark = reportRemark;
		this.reportFlag = reportFlag;
		this.rows = rows;
		this.reportTimetype = reportTimetype;
		this.reportMonth = reportMonth;
		this.reportYearTime = reportYearTime;
		this.reportVersion = reportVersion;
		this.reportTypeId = reportTypeId;
		this.reportEdition = reportEdition;
		this.selfSet1 = selfSet1;
		this.selfSet2 = selfSet2;
		this.selfSet3 = selfSet3;
		this.selfSet4 = selfSet4;
		this.selfSet5 = selfSet5;
		this.quarter = quarter;
		this.month = month;
		this.unitId = unitId;
		this.updateTime = updateTime;
	}

	@XmlElementWrapper
	@XmlElement(name = "row")
	public List<Row> getRows() {
		return null == rows ? new ArrayList<Row>() : rows;
	}

	public void setRows(List<Row> rows) {
		this.rows = rows;
	}

	/**
	 * @return the regionName
	 */
	public String getRegionName() {
		return regionName;
	}

	/**
	 * @param regionName the regionName to set
	 */
	public void setRegionName(String regionName) {
		this.regionName = regionName;
	}

	/**
	 * @return the reportUserId
	 */
	public String getReportUserId() {
		return reportUserId;
	}

	/**
	 * @param reportUserId the reportUserId to set
	 */
	public void setReportUserId(String reportUserId) {
		this.reportUserId = reportUserId;
	}

	/**
	 * @return the regionOcean
	 */
	public String getRegionOcean() {
		return regionOcean;
	}

	/**
	 * @param regionOcean the regionOcean to set
	 */
	public void setRegionOcean(String regionOcean) {
		this.regionOcean = regionOcean;
	}

	/**
	 * @return the cityName
	 */
	public String getCityName() {
		return cityName;
	}

	/**
	 * @param cityName the cityName to set
	 */
	public void setCityName(String cityName) {
		this.cityName = cityName;
	}

	/**
	 * @return the departmentName
	 */
	public String getDepartmentName() {
		return departmentName;
	}

	/**
	 * @param departmentName the departmentName to set
	 */
	public void setDepartmentName(String departmentName) {
		this.departmentName = departmentName;
	}

	/**
	 * @return the regionCode
	 */
	public String getRegionCode() {
		return regionCode;
	}

	/**
	 * @param regionCode the regionCode to set
	 */
	public void setRegionCode(String regionCode) {
		this.regionCode = regionCode;
	}

	/**
	 * @return the reportUnit
	 */
	public String getReportUnit() {
		return reportUnit;
	}

	/**
	 * @param reportUnit the reportUnit to set
	 */
	public void setReportUnit(String reportUnit) {
		this.reportUnit = reportUnit;
	}

	/**
	 * @return the institutionName
	 */
	public String getInstitutionName() {
		return institutionName;
	}

	/**
	 * @param institutionName the institutionName to set
	 */
	public void setInstitutionName(String institutionName) {
		this.institutionName = institutionName;
	}

	/**
	 * @return the institutionCode
	 */
	public String getInstitutionCode() {
		return institutionCode;
	}

	/**
	 * @param institutionCode the institutionCode to set
	 */
	public void setInstitutionCode(String institutionCode) {
		this.institutionCode = institutionCode;
	}

	/**
	 * @return the domainName
	 */
	public String getDomainName() {
		return domainName;
	}

	/**
	 * @param domainName the domainName to set
	 */
	public void setDomainName(String domainName) {
		this.domainName = domainName;
	}

	/**
	 * @return the domainCode
	 */
	public String getDomainCode() {
		return domainCode;
	}

	/**
	 * @param domainCode the domainCode to set
	 */
	public void setDomainCode(String domainCode) {
		this.domainCode = domainCode;
	}

	/**
	 * @return the reportYear
	 */
	public String getReportYear() {
		return reportYear;
	}

	/**
	 * @param reportYear the reportYear to set
	 */
	public void setReportYear(String reportYear) {
		this.reportYear = reportYear;
	}

	/**
	 * @return the reportQuarter
	 */
	public String getReportQuarter() {
		return reportQuarter;
	}

	/**
	 * @param reportQuarter the reportQuarter to set
	 */
	public void setReportQuarter(String reportQuarter) {
		this.reportQuarter = reportQuarter;
	}

	/**
	 * @return the reportNo
	 */
	public String getReportNo() {
		return reportNo;
	}

	/**
	 * @param reportNo the reportNo to set
	 */
	public void setReportNo(String reportNo) {
		this.reportNo = reportNo;
	}

	/**
	 * @return the reportId
	 */
	public String getReportId() {
		return reportId;
	}

	/**
	 * @param reportId the reportId to set
	 */
	public void setReportId(String reportId) {
		this.reportId = reportId;
	}

	/**
	 * @return the checkStatus
	 */
	public byte getCheckStatus() {
		return checkStatus;
	}

	/**
	 * @param checkStatus the checkStatus to set
	 */
	public void setCheckStatus(byte checkStatus) {
		this.checkStatus = checkStatus;
	}

	/**
	 * @return the checkComment
	 */
	public String getCheckComment() {
		return checkComment;
	}

	/**
	 * @param checkComment the checkComment to set
	 */
	public void setCheckComment(String checkComment) {
		this.checkComment = checkComment;
	}

	/**
	 * @return the reportAdmin
	 */
	public String getReportAdmin() {
		return reportAdmin;
	}

	/**
	 * @param reportAdmin the reportAdmin to set
	 */
	public void setReportAdmin(String reportAdmin) {
		this.reportAdmin = reportAdmin;
	}

	/**
	 * @return the approveAdmin
	 */
	public String getApproveAdmin() {
		return approveAdmin;
	}

	/**
	 * @param approveAdmin the approveAdmin to set
	 */
	public void setApproveAdmin(String approveAdmin) {
		this.approveAdmin = approveAdmin;
	}

	/**
	 * @return the approveNo
	 */
	public String getApproveNo() {
		return approveNo;
	}

	/**
	 * @param approveNo the approveNo to set
	 */
	public void setApproveNo(String approveNo) {
		this.approveNo = approveNo;
	}

	/**
	 * @return the expireDate
	 */
	public String getExpireDate() {
		return expireDate;
	}

	/**
	 * @param expireDate the expireDate to set
	 */
	public void setExpireDate(String expireDate) {
		this.expireDate = expireDate;
	}

	/**
	 * @return the measureUnit
	 */
	public String getMeasureUnit() {
		return measureUnit;
	}

	/**
	 * @param measureUnit the measureUnit to set
	 */
	public void setMeasureUnit(String measureUnit) {
		this.measureUnit = measureUnit;
	}

	/**
	 * @return the unitAdmin
	 */
	public String getUnitAdmin() {
		return unitAdmin;
	}

	/**
	 * @param unitAdmin the unitAdmin to set
	 */
	public void setUnitAdmin(String unitAdmin) {
		this.unitAdmin = unitAdmin;
	}

	/**
	 * @return the statAdmin
	 */
	public String getStatAdmin() {
		return statAdmin;
	}

	/**
	 * @param statAdmin the statAdmin to set
	 */
	public void setStatAdmin(String statAdmin) {
		this.statAdmin = statAdmin;
	}

	/**
	 * @return the fillAdmin
	 */
	public String getFillAdmin() {
		return fillAdmin;
	}

	/**
	 * @param fillAdmin the fillAdmin to set
	 */
	public void setFillAdmin(String fillAdmin) {
		this.fillAdmin = fillAdmin;
	}

	/**
	 * @return the reportDate
	 */
	public String getReportDate() {
		return reportDate;
	}

	/**
	 * @param reportDate the reportDate to set
	 */
	public void setReportDate(String reportDate) {
		this.reportDate = reportDate;
	}

	/**
	 * @return the checkSuccessDate
	 */
	public Date getCheckSuccessDate() {
		return checkSuccessDate;
	}

	/**
	 * @param checkSuccessDate the checkSuccessDate to set
	 */
	public void setCheckSuccessDate(Date checkSuccessDate) {
		this.checkSuccessDate = checkSuccessDate;
	}

	/**
	 * @return the createDate
	 */
	public Date getCreateDate() {
		return createDate;
	}

	/**
	 * @param createDate the createDate to set
	 */
	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	/**
	 * @return the lastEditDate
	 */
	public Date getLastEditDate() {
		return lastEditDate;
	}

	/**
	 * @param lastEditDate the lastEditDate to set
	 */
	public void setLastEditDate(Date lastEditDate) {
		this.lastEditDate = lastEditDate;
	}

	/**
	 * @return the reportTypeCode
	 */
	public String getReportTypeCode() {
		return reportTypeCode;
	}

	/**
	 * @param reportCode the reportCode to set
	 */
	public void setReportTypeCode(String reportTypeCode) {
		this.reportTypeCode = reportTypeCode;
	}

	/**
	 * @return the reportType
	 */
	public String getReportType() {
		return reportType;
	}

	/**
	 * @param reportType the reportType to set
	 */
	public void setReportType(String reportType) {
		this.reportType = reportType;
	}

	/**
	 * @return the reportOperatorId
	 */
	public String getReportOperatorId() {
		return reportOperatorId;
	}

	/**
	 * @param reportOperatorId the reportOperatorId to set
	 */
	public void setReportOperatorId(String reportOperatorId) {
		this.reportOperatorId = reportOperatorId;
	}

	public String getReportProxyId() {
		return reportProxyId;
	}

	public void setReportProxyId(String reportProxyId) {
		this.reportProxyId = reportProxyId;
	}

	public String getReportAreaId() {
		return reportAreaId;
	}

	public void setReportAreaId(String reportAreaId) {
		this.reportAreaId = reportAreaId;
	}

	/**
	 * @return the reportOrigin
	 */
	public String getReportOrigin() {
		return reportOrigin;
	}

	/**
	 * @param reportOrigin the reportOrigin to set
	 */
	public void setReportOrigin(String reportOrigin) {
		this.reportOrigin = reportOrigin;
	}

	/**
	 * @return the reportDesc
	 */
	public String getReportDesc() {
		return reportDesc;
	}

	/**
	 * @param reportDesc the reportDesc to set
	 */
	public void setReportDesc(String reportDesc) {
		this.reportDesc = reportDesc;
	}

	/**
	 * @return the reportSupplyOrigin
	 */
	public String getReportSupplyOrigin() {
		return reportSupplyOrigin;
	}

	/**
	 * @param reportSupplyOrigin the reportSupplyOrigin to set
	 */
	public void setReportSupplyOrigin(String reportSupplyOrigin) {
		this.reportSupplyOrigin = reportSupplyOrigin;
	}

	/**
	 * @return the reportUnitIndustry
	 */
	public String getReportUnitIndustry() {
		return reportUnitIndustry;
	}

	/**
	 * @param reportUnitIndustry the reportUnitIndustry to set
	 */
	public void setReportUnitIndustry(String reportUnitIndustry) {
		this.reportUnitIndustry = reportUnitIndustry;
	}

	/**
	 * @return the checkResult
	 */
	public String getCheckResult() {
		return checkResult;
	}

	/**
	 * @param checkResult the checkResult to set
	 */
	public void setCheckResult(String checkResult) {
		this.checkResult = checkResult;
	}

	/**
	 * @return the reportRemark
	 */
	public String getReportRemark() {
		return reportRemark;
	}

	/**
	 * @param reportRemark the reportRemark to set
	 */
	public void setReportRemark(String reportRemark) {
		this.reportRemark = reportRemark;
	}

	public String getReportReferenceId() {
		return reportReferenceId;
	}

	public void setReportReferenceId(String reportReferenceId) {
		this.reportReferenceId = reportReferenceId;
	}

	public String getReportFlag() {
		return reportFlag;
	}

	public void setReportFlag(String reportFlag) {
		this.reportFlag = reportFlag;
	}

	public String getReportTimetype() {
		return reportTimetype;
	}

	public void setReportTimetype(String reportTimetype) {
		this.reportTimetype = reportTimetype;
	}

	public String getReportMonth() {
		return reportMonth;
	}

	public void setReportMonth(String reportMonth) {
		this.reportMonth = reportMonth;
	}

	public String getReportYearTime() {
		return reportYearTime;
	}

	public void setReportYearTime(String reportYearTime) {
		this.reportYearTime = reportYearTime;
	}

	public String getReportVersion() {
		return reportVersion;
	}

	public void setReportVersion(String reportVersion) {
		this.reportVersion = reportVersion;
	}

	public String getReportTypeId() {
		return reportTypeId;
	}

	public void setReportTypeId(String reportTypeId) {
		this.reportTypeId = reportTypeId;
	}

	public String getReportEdition() {
		return reportEdition;
	}

	public void setReportEdition(String reportEdition) {
		this.reportEdition = reportEdition;
	}

	public String getReportUnitIndustryId() {
		return reportUnitIndustryId;
	}

	public void setReportUnitIndustryId(String reportUnitIndustryId) {
		this.reportUnitIndustryId = reportUnitIndustryId;
	}

	// public String getReportUnitIndustryId() {
	// return reportUnitIndustryId;
	// }
	//
	// public void setReportUnitIndustryId(String reportUnitIndustryId) {
	// this.reportUnitIndustryId = reportUnitIndustryId;
	// }

	public Integer getQuarter() {
		return quarter;
	}

	public void setQuarter(Integer quarter) {
		this.quarter = quarter;
	}

	public Integer getMonth() {
		return month;
	}

	public void setMonth(Integer month) {
		this.month = month;
	}

	public String getUnitId() {
		return unitId;
	}

	public void setUnitId(String unitId) {
		this.unitId = unitId;
	}

	public Date getUpdateTime() {
		return updateTime;
	}

	public void setUpdateTime(Date updateTime) {
		this.updateTime = updateTime;
	}

	public String getStatus() {
		return status;
	}

	public void setStatus(String status) {
		this.status = status;
	}

	public String getReportTime() {
		String result;
		// 年报
		if ("1".equals(reportTimetype)) {
			if ("1".equals(reportYearTime)) {
				result = String.format("%s年 上半年", reportYear);
			} else if ("2".equals(reportYearTime)) {
				result = String.format("%s年", reportYear);
			} else {
				result = String.format("%s年 快报", reportYear);
			}
		} else if ("0".equals(reportTimetype)) {
			result = reportMonth;
		} else {
			result = String.format("%s年%s", reportYear, reportQuarter);
		}
		return result;
	}

}
